The SixBit Application Programming Interface
Add and Update Processing

Each class has methods to add and update information in the class.  Some classes contain separate Class_Add and Class_Update methods and other classes combine the add and update into a single Class_AddUpdate method.  The use of different methods is determined by the nature of the data being added or updated.  

AddUpdate Methods

Data that is often provided in master lists that contain a current complete list of objects will use the Class_AddUpdate style.   This allows for importing the master list to with a single call to add any new objects and update any existing ones.   An example of this could be a list of items from a drop shipper that contains a complete list of inventory available at the drop shipper along with the current prices. 

By using Items_AddUpdate, the entire list can be provided to the API call.   Missing items in the database will be added and existing items will be updated.  If separate Items_Add and Items_Update functions were implemented, it would require breaking the master list into two lists.  One that contained the items to be added and one that contained the items to be updated.

When using an AddUpdate method, an Action parameter is provided to further customize how the import behaves.  It allows for only adding, only updating or performing both adds and updates.

The Buyers, CompatibilitySets, Items, and Suppliers classes use a combined AddUpdate method.

Separate Add and Update Methods

Data that is not usually part of a master list has separate add and update functions.   Orders will need to be imported as they occur.   A simple Orders_Add method is the best way to achieve this.   Likewise if a change occurs on an order, a simple Orders_Update method works best.

The Orders, Shipment and Sales classes use separate Add and Update methods.